﻿var mysql = require('mysql')
var config = require('../../config/config');
var log = require("../../config/log4js-config").getInstand;

var pool = mysql.createPool(config.mysqlConfig)

exports.test = function (callback){
	var sql = 'select now()';
	var values = [];
	pool.getConnection(function(err, connection){
	 	connection.query({sql:sql, values:values}, function(err, rows){
	 		connection.release();
			if (err){
				console.log(err);
				callback(0)
			}else{
				console.log(rows);
				callback(rows[0]['now()']);
			}
		})
	});
}
